package com.bwie.user.service.impl;

import com.bwie.common.domain.User;
import com.bwie.common.domain.request.UserRequest;
import com.bwie.common.result.Result;
import com.bwie.user.mapper.UserMapper;
import com.bwie.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public Result findByPhone(String phone) {
        User byPhone = userMapper.findByPhone(phone);
        return Result.success(byPhone);
    }

    @Override
    public Result regist(UserRequest userRequest) {
        Integer regist = userMapper.regist(userRequest);
        return Result.success(regist);
    }
}
